package org.springblade.modules.admin.task;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springblade.modules.admin.service.IElevatorRepeatFaultLogService;
import org.springblade.modules.admin.service.PlanHistoryImageService;
import org.springblade.modules.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Date 16:15 2024/9/25
 * @Description {
 *   AI图片处理结果
 * }
 * @Author lsay
 **/
@Component
@Slf4j
public class PlanHistoryImageJob {

	@Autowired
	private PlanHistoryImageService planHistoryImageService;

	/**
	 * 定时任务：每日10 15
	 */
	//@Scheduled(cron = "0 0 10,15 * * ?")
	@XxlJob(value = "countPlanHistoryImageStatus")
	public void selectRepeatFaultElevator() {

		XxlJobHelper.handleSuccess("AI图片处理结果-方法(countPlanHistoryImageStatus)-[执行]开始");

		planHistoryImageService.countPlanHistoryImageStatus();
		// 生成重复故障电梯数据
		try {
//			elevatorService.updateElevatorMaintainStatusDay();
			XxlJobHelper.handleSuccess("AI图片处理结果-方法(countPlanHistoryImageStatus)-[执行]成功");
		} catch (Exception e) {
			XxlJobHelper.handleSuccess("AI图片处理结果-方法(countPlanHistoryImageStatus)-[执行]失败" + e);
		}

	}

}
